﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace psafth.AMB
{

    /// <summary>
    /// Fields of record in general
    /// </summary>
    public enum AMBGeneralFOR
    {
        DECODER_ID = 0x81,          // (4 byte)
        CONTROLLER_ID = 0x83,       // (4 byte)
        REQUEST_ID = 0x85           // (8 byte)
    }

    /// <summary>
    /// Fields of record in GetTime 
    /// </summary>
    public enum AMBGetTimeFOR
    {
        RTC_TIME = 0x01,
        FLAGS = 0x04,
        UTC_TIME = 0x05
    }

    /// <summary>
    /// Fields of record in GeneralSettings
    /// </summary>
    public enum AMBGeneralSettingsFOR
    {
        STATUS_INTERVAL = 0x01,
        REAL_TIME_CLOCK = 0x03,
        FIRST_CONTACT = 0x07
    }

    /// <summary>
    /// Fields of record for messagetype PASSING
    /// </summary>
    public enum AMBPassingFOR
    {
        PASSING_NUMBER = 0x01,      // (4 byte) (example of "FOR" - 0x01(TOF):0x04(legth):0x00:0x00:0x00:0x00)
        TRANSPONDER = 0x03,         // (4 bytes)
        RTC_ID = 0x13,              // (4 bytes)
        RTC_TIME = 0x04,            // (8 byte, time microseconds after January 1, 1970 00:00:00 GMT)
        UTC_TIME = 0x10,            // (8 byte, time microseconds after January 1, 1970 00:00:00 GMT)
        STRENGTH = 0x05,            // (2 byte)
        HITS = 0x06,                // (2 byte)
        FLAGS = 0x08,               // (2 byte)
        TRAN_CODE = 0x0a,           // (1 byte)
        USER_FLAG = 0x0e,           // (4 byte)
        DRIVER_ID = 0x0f,           // (1 byte)
        SPORT = 0x14,               // (1 byte)
        VOLTAGE = 0x30,             // (1 byte, V = (float)voltage/10)
        TEMPERATURE = 0x31          // (1 byte, T = temperature - 100)
    }

    /// <summary>
    /// Fields of record for messagetype VERSION
    /// </summary>
    public enum AMBVersionFOR
    {
        DECODER_TYPE = 0x01,        // (1 byte)
        DESCRIPTION = 0x02,         // (variable)
        VERSION = 0x03,             // (variable)
        RELEASE = 0x04,             // (4 byte)
        REGISTRATION = 0x08,        // (8 byte)
        BUILD_NUMBER = 0x0A,        // (2 byte)
        OPTIONS = 0x0C              // (4 byte)
    }

    /// <summary>
    /// Fields of record for messagetype STATUS
    /// </summary>
    public enum AMBStatusFOR
    {
        NOISE = 0x01,               // (2 byte)
        GPS = 0x06,                 // (1 byte) (0=false, 1 =true)
        TEMPERATURE = 0x07,         // (2 byte)
        SATINUSE = 0x0a,            // (1 byte)
        LOOP_TRIGGERS = 0x0b,       // (1 byte)
        INPUT_VOLTAGE = 0x0c,       // (1 byte) (Voltage = (float) input_voltage/10)
    }

    /// <summary>
    /// Fields of record for messagetype ERROR
    /// </summary>
    public enum AMBErrorFOR
    {
        CODE = 0x1,                 // (2 byte)
        DESCRIPTION = 0x02          // (variable)
    }

    /// <summary>
    /// Fields of record for messagetype RESEND
    /// </summary>
    public enum AMBResendFOR
    {
        FROM = 0x01,                // (4 byte)
        UNTIL = 0x02                // (4 byte)
    }
}
